#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<cstdlib>
#include<cmath>
#include<sstream>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<stack>
#define PI acos(-1)
#define MP make_pair
#define PB push_back
#define VI vector <int>
#define PII pair <int,int>
#define LL long long
#define SET(v,i) memset(v, i, sizeof(v))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORD(i,a,b) for (int i = (a); i >= (b); i--)
#define FORN(i,a,b) for (int i = (a); i < (b); i++)
#define DOWN(i,a,b) for (int i = (a); i > (b); i--)
#define FIT(it,v) for (typeof(v.begin()) it = v.begin(); it != v.end(); it++)
#define FITD(it,v) for (typeof(v.rbegin()) it = v.rbegin(); it != v.rend(); it++)
using namespace std;
const int N=20005,mod=1000000007;
int a[N],b[N],c[N];
LL extend_gcd(LL a,LL b,LL &x,LL &y){
    if(b==0){x=1;y=0;return a;}
    LL ans=extend_gcd(b,a%b,x,y);LL t=x;x=y;y=t-(a/b)*y;
    return ans;   
    }
LL get_inverse(LL b,int mod){
    LL x,y;
    if(extend_gcd(b,mod,x,y)!=1)return -1;
    LL ans=(x%mod+mod)%mod;
    return ans==0?ans+b:ans;            
    }
inline int cal(int x,int y,int num){
	return ((LL)num*x)%mod*get_inverse(y,mod)%mod;
	}
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int i=n;i>=1;i--){
		if(i==n)b[n-i+1]=1;
		else b[n-i+1]=cal(k+(n-i)-1,n-i,b[n-i]);
		}
	for(int i=n;i>=1;i--){
		c[i]=0;
		for(int j=i;j>=1;j--){
			c[i]=(c[i]+(LL)a[i-j+1]*b[j]%mod)%mod;
			}
		}
	for(int i=1;i<=n;i++){
		if(i!=1)printf(" ");
		printf("%d",c[i]);
		}		
	puts("");
	return 0;
    }
